package com.project.personal_blog.garbage_classification_management_system.service.Impl;

import com.project.personal_blog.garbage_classification_management_system.mapper.userMapper;
import com.project.personal_blog.garbage_classification_management_system.pojo.User;
import com.project.personal_blog.garbage_classification_management_system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private userMapper userMapper;
    @Override
    public User selectByUsername(String username) {
        return userMapper.selectUserByUsername(username);
    }

    @Override
    public User selectById(Integer id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public User selectByPhoneNumber(String phoneNumber) {
        return userMapper.selectUserByPhoneNumber(phoneNumber);
    }

    @Override
    public User selectByEmail(String email) {
        return userMapper.selectUserByEmail(email);
    }

    @Override
    public boolean pageUser(Integer pageNumber, Integer pageSize) {
        return userMapper.PageUser(pageNumber, pageSize);
    }

    @Override
    public boolean sortById(Integer id1, Integer id2) {
        return userMapper.sortUserById(id1, id2);
    }

    @Override
    public boolean sortByName(String name1, String name2) {
        return userMapper.sortUserByName(name1, name2);
    }

    @Override
    public boolean sortByPhoneNumber(String phoneNumber1, String phoneNumber2) {
        return userMapper.sortUserByPhoneNumber(phoneNumber1, phoneNumber2);
    }

    @Override
    public boolean sortByEmail(String email1, String email2) {
        return userMapper.sortUserByEmail(email1, email2);
    }
}